import request from "@/utils/request"

export function getComments(params) {
  return request({
    method: "GET",
    url: "/v1_0/comments",
    params
  })
}

export function addCommentLike(commentId) {
  return request({
    method: "POST",
    url: "/v1_0/comment/likings",
    data: {
      target: commentId
    }
  })
}

export function deleteCommentLike(commentId) {
  return request({
    method: "DELETE",
    url: `/v1_0/comment/likings/${commentId}`
  })
}

export function addComment(data) {
  return request({
    method: "POST",
    url: "/v1_0/comments",
    data
  })
}
